package com.pmsystem.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.pmsystem.dao.WaterConsumeMapper;
import com.pmsystem.pojo.WaterConsume;
import com.pmsystem.util.BeanUtil;

@Service
public class WaterConsumeService {

	@Autowired
	private WaterConsumeMapper waterConsumeMapper;

	/**
	 * 
	 * <p>Title: addWaterConsume</p >  
	 * <p>Description: 录入水费</p >  
	 * @author 泽强
	 * @param waterConsume
	 * @return
	 */
	public boolean addWaterConsume(WaterConsume waterConsume) {
		int flag = waterConsumeMapper.insertSelective(waterConsume);
		return flag==1?true:false;
	}

	/**
	 * 
	 * <p>Title: findWaterConsume</p >  
	 * <p>Description: 按一定条件查水表</p >  
	 * @author 泽强
	 * @param map
	 * @return
	 */
	public List<WaterConsume> findWaterConsume(Map<String, Object> map) {
		waterConsumeMapper.findWaterConsume(BeanUtil.mapToMapWithoutNull(map));
		return null;
	}

	/**
	 * 
	 * <p>Title: updateWaterConsume</p >  
	 * <p>Description: 修改水费</p >  
	 * @author 泽强
	 * @param waterConsume
	 * @return
	 */
	public boolean updateWaterConsume(WaterConsume waterConsume) {
		int flag = waterConsumeMapper.updateByPrimaryKeySelective(waterConsume);
		return flag==1?true:false;
	}
	
	
}
